package com.yjzx.util.service.enums.file;

/**
 * @author yjzx
 * @date 2024/8/13
 * @description 文本文件类型枚举
 */
public enum TextFileTypeEnum implements FileType {
    /**
     * 常见的文本类型文件
     */
    JAVA(".java", "text/x-java"),
    JSP(".jsp", "text/html"),
    PYTHON(".py", "text/x-python"),
    HTML(".html", "text/html"),
    HTM(".htm", "text/html"),
    CSS(".css", "text/css"),
    JS(".js", "text/javascript"),
    PHP(".php", "text/x-php"),
    RB(".rb", "text/x-ruby"),
    TCL(".tcl", "text/x-tcl"),
    C(".c", "text/x-csrc"),
    CC(".cc", "text/x-csrc"),
    CXX(".cxx", "text/x-csrc"),
    H(".h", "text/x-csrc"),
    HH(".hh", "text/x-csrc"),
    HPP(".hpp", "text/x-csrc"),
    HXX(".hxx", "text/x-csrc"),
    CPP(".cpp", "text/x-csrc"),
    CS(".cs", "text/x-csharp"),
    TS(".ts", "application/typescript"),
    XML(".xml", "application/xml"),
    SQL(".sql", "application/sql"),
    SCALA(".scala", "text/x-scala"),
    GO(".go", "text/x-go"),
    RUBY(".rb", "text/x-ruby"),
    RUST(".rs", "text/x-rustsrc"),
    SWIFT(".swift", "text/x-swift"),
    KOTLIN(".kt", "text/x-kotlin"),
    PERL(".pl", "text/x-perl"),
    SHELL(".sh", "application/x-sh"),
    VBNET(".vb", "text/x-vb"),
    FSHARP(".fs", "text/x-fsharp"),
    COFFEESCRIPT(".coffee", "text/coffeescript"),
    MARKDOWN(".md", "text/markdown"),
    GRADLE(".gradle", "text/x-groovy"),
    GROOVY(".groovy", "text/x-groovy"),
    DOCKERFILE(".dockerfile", "text/x-dockerfile"),
    MAKEFILE(".mk", "text/x-makefile"),
    VUE(".vue", "text/x-vue"),
    JSX(".jsx", "text/jsx"),
    TSX(".tsx", "text/jsx"),
    LUA(".lua", "text/x-lua"),
    R(".r", "text/x-r"),
    DART(".dart", "text/x-dart"),
    JAVASCRIPT(".js", "application/javascript"),
    TYPESCRIPT(".ts", "application/typescript"),
    BIZ(".biz", "text/xml"),
    CMD(".cmd", "text/x-sh"),
    BAT(".bat", "text/x-sh"),

    APPLICATION(".app", "text/plain"),
    WINDOWS_APP(".app", "application/octet-stream"),
    MAC_OS_APP(".app", "application/x-mac-app-bundle"),

    INI(".ini", "text/plain"),
    PROPERTIES(".properties", "text/plain"),
    CONF(".conf", "text/plain"),
    YML(".yml", "text/plain"),
    YAML(".yaml", "text/plain"),
    JSON(".json", "text/plain"),

    ASP(".asp", "text/asp"),
    ASA(".asa", "text/asa"),
    CSV(".csv", "text/plain"),
    TSV(".tsv", "text/plain"),
    BACKUP(".bak", "text/plain"),
    LOG(".log", "text/plain"),
    TXT(".txt", "text/plain"),
    TXT_UTF8(".txt", "text/plain;charset=UTF-8"),
    TXT_GBK(".txt", "text/plain;charset=GBK"),
    TXT_UTF16(".txt", "text/plain;charset=UTF-16"),
    ;
    private final String extension;

    private final String mimeType;

    TextFileTypeEnum(String extension, String mimeType) {
        this.extension = extension;
        this.mimeType = mimeType;
    }

    @Override
    public String getExtension() {
        return extension;
    }

    @Override
    public String getMimeType() {
        return mimeType;
    }

}
